package com.yztc.yidoutang.fragment.danpin_fragment;

import com.yztc.yidoutang.bean.DanPinBean;

import rx.Subscriber;

/**
 * Created by My on 2016/10/20.
 */

public class DanPinPresenter implements DanPinContract.Presenter{
    private DanPinContract.Model model;
    private DanPinContract.View view;

    public DanPinPresenter(DanPinContract.View view) {
        this.view = view;
        this.model=new DanPinModel();
    }

    @Override
    public void getDPData(String queryWords) {
        model.getDPData(queryWords, new Subscriber<DanPinBean>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onNext(DanPinBean danPinBean) {
                view.GetDPDataSuccess(danPinBean.getData().getSharings());
            }
        });
    }
}
